package no.ntnu.item.ttm4115.termproject.teacheragent.gui;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import java.util.HashMap;
import java.util.Vector;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.LayoutStyle;


import no.ntnu.item.ttm4115.termproject.StartGameFromGUI;
import no.ntnu.item.ttm4115.termproject.StartSelectedGameNow;
import no.ntnu.item.ttm4115.termproject.StartUpGame;
import no.ntnu.item.ttm4115.termproject.extrasagent.Game;
import no.ntnu.item.ttm4115.termproject.extrasagent.Group;
import no.ntnu.item.ttm4115.termproject.extrasagent.Player;
import no.ntnu.item.ttm4115.termproject.extrasagent.Treasures;
import no.tellu.common.actorframe.ActorSM;
import no.tellu.common.javaframe.ActorAddress;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class TeacherGUI extends javax.swing.JFrame  {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	@SuppressWarnings("unused")
	private ActorSM asm;
	private Vector<Player> players;
	private Vector<Group> groups;
	private Vector<Treasures> gameConfig;
	private HashMap<String, Game> games;
	private HashMap<String, ActorAddress> hashGames;
	
   
    public TeacherGUI(ActorSM asm,Vector<Player> players,Vector<Group> groups,Vector<Treasures> gameConfig,HashMap<String, Game> games) {
    	super("Teacher Client");
    	this.players = players;
        this.groups = groups;
       	this.asm = asm;
       	this.gameConfig = gameConfig;
       	this.games = games;
       	
    	initComponents();
    	
    }
    public TeacherGUI(){
    	super("Teacher Client");
    	initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
   
    private void initComponents() {
    	
        startPanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        {
        	initiateGameLabel = new JLabel();
        	initiateGameLabel.setText("Start Loaded Game");
        }
        {
        	startTheGameNOW = new JButton();
        	startTheGameNOW.setIcon(new javax.swing.ImageIcon(getClass().getResource("001_11.png")));
        	startTheGameNOW.addActionListener(new ActionListener() {
        		public void actionPerformed(ActionEvent evt) {
        			initiateGameNOW(evt);
        		}
        	});
        }
        {
        	modifyGroupButton = new JButton();
        	modifyGroupButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("001_45.png")));
        	modifyGroupButton.addActionListener(new ActionListener() {
        		public void actionPerformed(ActionEvent evt) {
        			modifyGroupButtonActionPerformed(evt);
        		}
        	});
        }
        {
        	jLabel3 = new JLabel();
        	jLabel3.setText("Modify Group");
        }
        jTextPane1 = new javax.swing.JTextPane();
        newGameButton = new javax.swing.JButton();
        modifyGameButton = new javax.swing.JButton();
        newUserButton = new javax.swing.JButton();
        modifyUserButton = new javax.swing.JButton();
        newGameLabel = new javax.swing.JLabel();
        modifyGameLabel = new javax.swing.JLabel();
        newUserLabel = new javax.swing.JLabel();
        modifyUserLabel = new javax.swing.JLabel();
        startGameButton = new javax.swing.JButton();
        startGameFromConfig = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        newGame = new javax.swing.JMenuItem();
        modifyGame = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JSeparator();
        newPlayer = new javax.swing.JMenuItem();
        modifyPlayer = new javax.swing.JMenuItem();
        newGroup = new javax.swing.JMenuItem();
        modifyGroup = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        startGameMenuItem = new javax.swing.JMenuItem();
        homeMenuItem = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JSeparator();
        jSeparator3 = new javax.swing.JSeparator();
        addTreasureMenuItem = new javax.swing.JMenuItem();
        modifyTreasureMenuItem = new javax.swing.JMenuItem();
      
        
        

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);

        startPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel1.setText("Welcome to teacher client");
        {
        	addGroupButton = new JButton();
        	addGroupButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("001_57.png")));
        	addGroupButton.addActionListener(new ActionListener() {
        		public void actionPerformed(ActionEvent evt) {
        			addGroupButtonActionPerformed(evt);
        		}
        	});
        }
        {
        	jLabel2 = new JLabel();
        	jLabel2.setText("Add Group");
        }

        jTextPane1.setBackground(new java.awt.Color(236, 233, 216));
        jTextPane1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jTextPane1.setEditable(false);
        jTextPane1.setText("From here you will be able to follow the game and make adjustments. Underneath and in the menu above you fill find valuable functions for doing so.");
        jTextPane1.setFocusable(false);
        jTextPane1.setOpaque(false);
        jScrollPane1.setViewportView(jTextPane1);

        newGameButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("001_01.png"))); // NOI18N
        newGameButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newGameButtonActionPerformed(evt);
            }
        });

        modifyGameButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("001_45.png"))); // NOI18N
        modifyGameButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modifyGameButtonActionPerformed(evt);
            }
        });

        newUserButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("001_55.png"))); // NOI18N
        newUserButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newUserButtonActionPerformed(evt);
            }
        });

        modifyUserButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("001_45.png"))); // NOI18N
        modifyUserButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modifyUserButtonActionPerformed(evt);
            }
        });

        newGameLabel.setText("New Game");

        modifyGameLabel.setText("Modify Game");

        newUserLabel.setText("New User");

        modifyUserLabel.setText("Modify User");

        startGameButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("001_39.png"))); // NOI18N
        startGameButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                startGameButtonActionPerformed(evt);
            }
        });

        startGameFromConfig.setText("Load Game from file");

        javax.swing.GroupLayout startPanelLayout = new javax.swing.GroupLayout(startPanel);
        startPanel.setLayout(startPanelLayout);
        startPanelLayout.setVerticalGroup(startPanelLayout.createSequentialGroup()
        	.addContainerGap()
        	.addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
        	.addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
        	.addGap(27)
        	.addGroup(startPanelLayout.createParallelGroup()
        	    .addGroup(GroupLayout.Alignment.LEADING, startPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	        .addComponent(addGroupButton, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	        .addComponent(newUserButton, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	        .addComponent(newGameButton, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	    .addGroup(startPanelLayout.createSequentialGroup()
        	        .addGap(19)
        	        .addGroup(startPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	            .addComponent(jLabel2, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	            .addComponent(newUserLabel, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	            .addComponent(newGameLabel, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))))
        	.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
        	.addGroup(startPanelLayout.createParallelGroup()
        	    .addGroup(GroupLayout.Alignment.LEADING, startPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	        .addComponent(modifyGroupButton, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	        .addComponent(modifyUserButton, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	        .addComponent(modifyGameButton, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	    .addGroup(startPanelLayout.createSequentialGroup()
        	        .addGap(19)
        	        .addGroup(startPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	            .addComponent(jLabel3, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	            .addComponent(modifyUserLabel, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	            .addComponent(modifyGameLabel, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))))
        	.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
        	.addGroup(startPanelLayout.createParallelGroup()
        	    .addGroup(GroupLayout.Alignment.LEADING, startPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	        .addComponent(startTheGameNOW, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	        .addComponent(startGameButton, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	    .addGroup(startPanelLayout.createSequentialGroup()
        	        .addGap(10)
        	        .addGroup(startPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
        	            .addComponent(startGameFromConfig, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	            .addComponent(initiateGameLabel, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, 14, GroupLayout.PREFERRED_SIZE))
        	        .addGap(9)))
        	.addContainerGap(123, 123));
        startPanelLayout.setHorizontalGroup(startPanelLayout.createSequentialGroup()
        	.addContainerGap()
        	.addGroup(startPanelLayout.createParallelGroup()
        	    .addComponent(jScrollPane1, GroupLayout.Alignment.LEADING, 0, 584, Short.MAX_VALUE)
        	    .addGroup(startPanelLayout.createSequentialGroup()
        	        .addGroup(startPanelLayout.createParallelGroup()
        	            .addGroup(startPanelLayout.createSequentialGroup()
        	                .addPreferredGap(jLabel1, startGameButton, LayoutStyle.ComponentPlacement.INDENT)
        	                .addGroup(startPanelLayout.createParallelGroup()
        	                    .addComponent(startGameButton, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                    .addComponent(modifyGameButton, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                    .addComponent(newGameButton, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	                .addGap(18)
        	                .addGroup(startPanelLayout.createParallelGroup()
        	                    .addComponent(startGameFromConfig, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                    .addGroup(GroupLayout.Alignment.LEADING, startPanelLayout.createSequentialGroup()
        	                        .addComponent(modifyGameLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                        .addGap(33))
        	                    .addGroup(GroupLayout.Alignment.LEADING, startPanelLayout.createSequentialGroup()
        	                        .addComponent(newGameLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                        .addGap(44))))
        	            .addGroup(GroupLayout.Alignment.LEADING, startPanelLayout.createSequentialGroup()
        	                .addComponent(jLabel1, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                .addGap(19)))
        	        .addGap(52)
        	        .addGroup(startPanelLayout.createParallelGroup()
        	            .addComponent(startTheGameNOW, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	            .addComponent(modifyUserButton, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	            .addComponent(newUserButton, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	        .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
        	        .addGroup(startPanelLayout.createParallelGroup()
        	            .addComponent(initiateGameLabel, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 97, GroupLayout.PREFERRED_SIZE)
        	            .addGroup(GroupLayout.Alignment.LEADING, startPanelLayout.createSequentialGroup()
        	                .addComponent(modifyUserLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                .addGap(40))
        	            .addGroup(GroupLayout.Alignment.LEADING, startPanelLayout.createSequentialGroup()
        	                .addComponent(newUserLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                .addGap(51)))
        	        .addGap(16)
        	        .addGroup(startPanelLayout.createParallelGroup()
        	            .addComponent(modifyGroupButton, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	            .addComponent(addGroupButton, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
        	        .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
        	        .addGroup(startPanelLayout.createParallelGroup()
        	            .addComponent(jLabel3, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	            .addGroup(GroupLayout.Alignment.LEADING, startPanelLayout.createSequentialGroup()
        	                .addComponent(jLabel2, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
        	                .addGap(13)))
        	        .addGap(47)))
        	.addContainerGap());

        fileMenu.setText("File");

        newGame.setText("New Game");
        newGame.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newGameActionPerformed(evt);
            }
        });
        fileMenu.add(newGame);

        modifyGame.setText("Modify Game");
        modifyGame.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modifyGameActionPerformed(evt);
            }
        });
        fileMenu.add(modifyGame);
        fileMenu.add(jSeparator1);

        newPlayer.setText("New Player");
        newPlayer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newPlayerActionPerformed(evt);
            }
        });
        fileMenu.add(newPlayer);

        modifyPlayer.setText("Modify Player");
        modifyPlayer.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modifyPlayerActionPerformed(evt);
            }
        });
        fileMenu.add(modifyPlayer);
        fileMenu.add(jSeparator2);
        
        newGroup.setText("New Group");
        newGroup.addActionListener(new java.awt.event.ActionListener() {
        	public void actionPerformed(java.awt.event.ActionEvent evt) {
        		newGroupActionPerformed(evt);
        	}
        });
        fileMenu.add(newGroup);
        
        modifyGroup.setText("Modify Group");
        modifyGroup.addActionListener(new java.awt.event.ActionListener() {
        	public void actionPerformed(java.awt.event.ActionEvent evt) {
        		modifyGroupActionPerformed(evt);
        	}
        });
        fileMenu.add(modifyGroup);
        fileMenu.add(jSeparator3);
        
        addTreasureMenuItem.setText("New Treasure");
        addTreasureMenuItem.addActionListener(new java.awt.event.ActionListener() {
        	public void actionPerformed(java.awt.event.ActionEvent evt) {
        		addTreasureActionPerformed(evt);
        	}
        });
        fileMenu.add(addTreasureMenuItem);
        
        modifyTreasureMenuItem.setText("Edit Treasure");
        modifyTreasureMenuItem.addActionListener(new java.awt.event.ActionListener() {
        	public void actionPerformed(java.awt.event.ActionEvent evt) {
        		modifyTreasureActionPerformed(evt);
        	}
        });
        fileMenu.add(modifyTreasureMenuItem);
        
             
    
        jMenuBar1.add(fileMenu);

        jMenu2.setText("Edit");
        
        startGameMenuItem.setText("Load Game to Server");
        startGameMenuItem.addActionListener(new java.awt.event.ActionListener() {
        	public void actionPerformed(java.awt.event.ActionEvent evt) {
        		startGameMenuItemActionPerformed(evt);
        	}
        });
        jMenu2.add(startGameMenuItem);
        
        homeMenuItem.setText("Home");
        homeMenuItem.addActionListener(new java.awt.event.ActionListener() {
        	public void actionPerformed(java.awt.event.ActionEvent evt) {
        		homeMenuItemActionPerformed(evt);
        	}
        });
        jMenu2.add(homeMenuItem);
        
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(startPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(startPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 363, Short.MAX_VALUE)
        );
        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-610)/2, (screenSize.height-447)/2, 610, 447);
       
    }

    private void newGameActionPerformed(java.awt.event.ActionEvent evt) {
    	this.remove(startPanel);
    	@SuppressWarnings("unused")
		NewGame gameGUI  = new NewGame(this,this.asm);
    }

	private void modifyGameActionPerformed(java.awt.event.ActionEvent evt) {
		//org.w3c.tools.widgets.MessagePopup pop = new org.w3c.tools.widgets.MessagePopup("Not yet implemeted");
	}
	public void initiateGameNOW(java.awt.event.ActionEvent evt){
		asm.sendMessage(new StartUpGame(),hashGames.get("Mitt Game"));
	}

	private void newPlayerActionPerformed(java.awt.event.ActionEvent evt) {
		this.remove(startPanel);
		@SuppressWarnings("unused")
		NewPlayer playerGUI  = new NewPlayer(this,this.asm);
    
	}
	private void modifyTreasureActionPerformed(java.awt.event.ActionEvent evt){
		this.remove(startPanel);
		ModifyTreasure modTreasureGUI = new ModifyTreasure(this,this.asm);
	}
	private void addTreasureActionPerformed(java.awt.event.ActionEvent evt){
		this.remove(startPanel);
		AddTreasure treasureGUI = new AddTreasure(this,this.asm);
	}
	
	private void startGameMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
		this.remove(startPanel);
		LoadGame loadGame = new LoadGame(this,this.asm);
		//asm.sendMessage(new StartGameFromGUI("Mitt Game"),new ActorAddress("/configurationAgent","ConfigurationAgent"));
	}
	
	private void homeMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
		this.remove(startPanel);
		initComponents();
	}
	private void newGroupActionPerformed(java.awt.event.ActionEvent evt) {
		this.remove(startPanel);
		@SuppressWarnings("unused")
		NewGroup newGroupGUI = new NewGroup(this,this.asm);
	}
	private void modifyGroupActionPerformed(java.awt.event.ActionEvent evt) {
		this.remove(startPanel);
		ModifyGroup modifyGroupGUI = new ModifyGroup(this,this.asm);
	}

	private void modifyPlayerActionPerformed(java.awt.event.ActionEvent evt) {
		this.remove(startPanel);
		@SuppressWarnings("unused")
		ModifyPlayer modifyPlayerGUI  = new ModifyPlayer(this,this.asm);
	}

	private void newGameButtonActionPerformed(java.awt.event.ActionEvent evt) {
		this.remove(startPanel);
		@SuppressWarnings("unused")
		NewGame gameGUI  = new NewGame(this,this.asm);
	}

	private void modifyGameButtonActionPerformed(java.awt.event.ActionEvent evt) {
		this.remove(startPanel);
		@SuppressWarnings("unused")
		ModifyGame modGame = new ModifyGame();
	}

	private void startGameButtonActionPerformed(java.awt.event.ActionEvent evt) {
		this.remove(startPanel);
		LoadGame loadGame = new LoadGame(this,this.asm);
	}

	private void newUserButtonActionPerformed(java.awt.event.ActionEvent evt) {
		this.remove(startPanel);
		@SuppressWarnings("unused")
		NewPlayer playerGUI  = new NewPlayer(this,this.asm);
	}

	private void modifyUserButtonActionPerformed(java.awt.event.ActionEvent evt) {
		this.remove(startPanel);
		@SuppressWarnings("unused")
		ModifyPlayer modifyPlayerGUI  = new ModifyPlayer(this,this.asm);
	}
	public void setStartPanel(javax.swing.JPanel p){
		startPanel = p;
	}
	public Vector<Group> getGroups(){
		return groups;
	}
	public Vector<Player> getPlayers(){
		return players;
	}
	public Vector<Treasures> getTreasures(){
		return gameConfig;
	}
	public HashMap<String, Game> getGames(){
		return games;
	}
	public HashMap<String, ActorAddress> getHashedGames(){
		return hashGames;
	}
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TeacherGUI().setVisible(true);
            }
        });
    }
    
    private void addGroupButtonActionPerformed(ActionEvent evt) {
    	this.remove(startPanel);
    	@SuppressWarnings("unused")
		NewGroup newGroupGUI = new NewGroup(this,this.asm);
    }
    
    private void modifyGroupButtonActionPerformed(ActionEvent evt) {
    	this.remove(startPanel);
    	ModifyGroup modifyGroupGUI = new ModifyGroup(this,this.asm);
    }
    public void setHashGames(HashMap<String, ActorAddress> map){
    	this.hashGames = map;
    }
    

    // Variables declaration - do not modify
    private javax.swing.JMenu fileMenu;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTextPane jTextPane1;
    private javax.swing.JMenuItem modifyGame;
    private javax.swing.JButton modifyGameButton;
    private javax.swing.JLabel modifyGameLabel;
    private javax.swing.JMenuItem modifyPlayer;
    private javax.swing.JButton modifyUserButton;
    private javax.swing.JLabel modifyUserLabel;
    private javax.swing.JMenuItem newGame;
    private javax.swing.JButton newGameButton;
    private javax.swing.JLabel newGameLabel;
    private javax.swing.JMenuItem newPlayer;
    private javax.swing.JButton newUserButton;
    private javax.swing.JLabel newUserLabel;
    private javax.swing.JButton startGameButton;
    private javax.swing.JLabel startGameFromConfig;
    private javax.swing.JPanel startPanel;
    private JLabel initiateGameLabel;
    private javax.swing.JMenuItem homeMenuItem;
    private JButton startTheGameNOW;
    private javax.swing.JMenuItem startGameMenuItem;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JMenuItem addTreasureMenuItem;
    private javax.swing.JMenuItem modifyTreasureMenuItem;
    private JLabel jLabel3;
    private JButton modifyGroupButton;
    private JLabel jLabel2;
    private JButton addGroupButton;
    private javax.swing.JMenuItem newGroup;
    private javax.swing.JMenuItem modifyGroup;
    private javax.swing.JSeparator jSeparator2;

    // End of variables declaration

}
